import{createRouter,createWebHashHistory} from "vue-router"
import { navData } from "@/untils/nav"



const routes=[
    {path:'/event',components:Event},
    {id:1,name:'Event',title:'组件通信',path:'/index',component:"views/event/index.vue"},
    
]

navData.forEach((element)=>{
    routes.push({
        id:element.id,
        name:element.name,
        title:element.title,
        path:element.path,
        component:()=>import("@/"+element.component)
    })
})


const router=createRouter({

    history:createWebHashHistory(),
    routes,
})
export default router

